package com.hs.room.mapper

import com.hs.common.dto.SysRoleDto
import com.hs.common.dto.SysUserDto
import com.hs.room.model.sys.SysRole
import com.hs.room.model.sys.SysUser
import org.mapstruct.Mapper
import org.mapstruct.factory.Mappers

@Mapper
interface RoleMapper {

    // 映射单个 User 到 UserDTO
    fun roleToRoleDTO(role: SysRole  ): SysRoleDto

    fun roleDtoToRole(roleDto: SysRoleDto): SysRole

    // 映射 List<User> 到 List<UserDTO>
    fun rolesToRoleDTOs(users: List<SysRole>): List<SysRoleDto>

    // 获取 Mapper 实例
    companion object {
        val INSTANCE: RoleMapper = Mappers.getMapper(RoleMapper::class.java)
    }


}